package com.ts.auth.feign;

import com.ts.auth.feign.fallback.UserFeignClientFallback;
import com.ts.auth.pojo.dto.userOrg.TbPermission;
import com.ts.auth.pojo.dto.userOrg.TbUser;
import com.ts.common.pojo.resp.TResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.security.Permission;
import java.util.List;

@FeignClient(name = "TSING-LUNG-USER-ORG",value = "TSING-LUNG-USER-ORG",fallback = UserFeignClientFallback.class)
public interface UserFeignClient {

    @GetMapping("/spi/v1/user/name")
    TResponse<TbUser> getByName(@RequestParam("name") String name);

    @GetMapping("/spi/v1/user/permission/list")
    TResponse<List<TbPermission>> getPermissionByUserId(@RequestParam("userId") Long id);
}
